#!/bin/bash
set -e
set -x
MYDIR="${0%/*}"
cd "$MYDIR/.."
source "recipes/common.sh"


# RECIPE START ninja
#
# depends: Python-native
# depends: ninja-native

rm -rf build/ninja
mkdir -p build/ninja
cd build/ninja

env \
	CXX="${TARGET}-g++" \
	AR="${TARGET}-ar" \
	LDFLAGS="$LDFLAGS -static-libgcc -static-libstdc++" \
	CFLAGS="$CFLAGS -fPIC" \
python3 ../../ninja/configure.py
ninja

mkdir -p -m755 "${stage}${prefix}/bin"
cp -a ninja "${stage}${prefix}/bin/"
cd ../..

# RECIPE END ninja
